﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DOTNET101_Assemblies_GAC
{
    class TestAssembly
    {
        static void Main()
        {
            try
            {
                System.Reflection.AssemblyName testAssembly =
                    System.Reflection.AssemblyName.GetAssemblyName(@"C:\WINDOWS\syswow64\avicap32.dll");

                System.Console.WriteLine("Yes, the file is an Assembly.");
            }

            catch (System.IO.FileNotFoundException)
            {
                System.Console.WriteLine("The file cannot be found.");
            }

            catch (System.BadImageFormatException)
            {
                System.Console.WriteLine("The file is not an Assembly.");
            }

            catch (System.IO.FileLoadException)
            {
                System.Console.WriteLine("The Assembly has already been loaded.");
            }
        }
    }
}
